home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Today - The Disc! 5
/
CD-ROM Today - The Disc (Issue 5)(November 1994).ISO
/
mac
/
Mac shareware
/
Education
/
RLaB
/
examples
/
conv.r
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1994-09-21
|
314 b
|
20 lines
|
[
TEXT/ttxt
]
#
# Simplistic convolution function.
# x and y must be vectors...
# No error checking.
#
conv = function( x , y )
{
local( X , Y , n, tmp );
n = x.n + y.n - 1;
X = fft( x, n );
Y = fft( y, n );
tmp = ifft( X .* Y );
if( type(x) == "real" && type(y) == "real") { tmp = real(tmp); }
return tmp;
};